# $OpenBSD: Makefile,v 1.44 2015/04/08 07:51:54 kirby Exp $

COMMENT-main=	checks HTML documents for broken links, CLI
COMMENT-x11=	checks HTML documents for broken links, GUI

V=		9.3
REVISION-main=	0
MODPY_EGG_VERSION=${V}
GH_ACCOUNT=	wummel
GH_PROJECT=	linkchecker
GH_TAGNAME=	upstream/$V

DISTNAME=	${GH_PROJECT}-${V}
PKGNAME-main=	${DISTNAME}
PKGNAME-x11=	${GH_PROJECT}-gui-${V}
CATEGORIES=    	www

HOMEPAGE=	http://wummel.github.io/linkchecker/

MAINTAINER=	Amit Kulkarni <amitkulz@gmail.com>

# GPLv2+
PERMIT_PACKAGE_CDROM=	Yes

WANTLIB+=	${MODPY_WANTLIB} pthread

MODULES=	devel/gettext lang/python

RUN_DEPENDS-main=	net/py-dnspython \
			www/py-requests

RUN_DEPENDS-x11=	devel/desktop-file-utils \
			www/linkchecker,-main \
			x11/gtk+3,-guic \
			x11/py-qt4

SEPARATE_BUILD=		Yes
MULTI_PACKAGES=		-main -x11

WRKDIST=	${WRKDIR}/${GH_PROJECT}-upstream-${V}
NO_TEST=	Yes

post-extract:
	@perl -pi -e 's,logo48x48,linkchecker,' ${WRKSRC}/doc/*.desktop

post-install:
.for s in 16 32 48 64 128
	${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/${s}x${s}/apps
	${INSTALL_DATA} ${WRKSRC}/doc/html/logo${s}x${s}.png \
		${PREFIX}/share/icons/hicolor/${s}x${s}/apps/linkchecker.png
.endfor
	${INSTALL_DATA} ${WRKSRC}/doc/html/lccollection.qhcp \
		${PREFIX}/share/linkchecker/lccollection.qhc

.include <bsd.port.mk>
